home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / cuser125.zip / COOLUSER.MH < prev    next >
Text File  |  1997-07-12  |  6KB  |  250 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // CoolUser V1.25 (C)1996-1997 Neil Staib Global Settings
  4. //
  5. // MEX: Copywrite 1990, 1995 by Lanius Corporation. All Rights reserved.
  6. //
  7. //////////////////////////////////////////////////////////////////////////////
  8. //
  9. // Uncomment which ones you wish let yout users have.
  10. //
  11.  
  12. #define     handle_opt
  13. #define     location_opt
  14. #define     voice_opt
  15. #define     data_opt
  16. #define     birth_opt
  17. //#define     gender_opt
  18. #define     password_opt
  19. //#define     language_opt
  20. #define     protocol_opt
  21. #define     msg_editor_opt
  22. //#define     scn_width_opt
  23. //#define     clear_opt // Must set to uncomment to create screen style.
  24. #define     quiet_opt
  25. #define     ansi_opt
  26. //#define     hidden_opt
  27. #define     msg_viewer_opt
  28. #define     scn_length_opt
  29. #define     more_opt
  30. #define     hot_opt
  31. //#define     avatar_opt
  32. #define     qwk_opt
  33. //#define     help_opt
  34. //#define     rip_opt
  35.  
  36. //////////////////////////////////////////////////////////////////////////////
  37. // If you have external protocols commment out the below
  38. //////////////////////////////////////////////////////////////////////////////
  39. #define internal_not
  40.  
  41. //////////////////////////////////////////////////////////////////////////////
  42. // Enter in Date format
  43. //////////////////////////////////////////////////////////////////////////////
  44.  
  45. //#define USDATE
  46. #define EUDATE
  47. //#define JPDATE
  48.  
  49. ////////////////////////////////////////////////////////////////////////////////
  50. //
  51. //  Number of phone numbers for your area eg mine is 8 being 55477184
  52. //
  53. ////////////////////////////////////////////////////////////////////////////////
  54.  
  55. #define phone_no 8
  56.  
  57. ////////////////////////////////////////////////////////////////////////////////
  58. //
  59. //  Minimum age callers can be.
  60. ////////////////////////////////////////////////////////////////////////////////
  61.  
  62. #define min_age  5 // Callers should old then 5 years old
  63.  
  64.  
  65. ////////////////////////////////////////////////////////////////////////////////
  66. // Internal Sub Routines
  67. ////////////////////////////////////////////////////////////////////////////////
  68.  
  69. string Bool(int: i)
  70. {
  71.     if (i <> 0)
  72.         return str_yes;
  73.     return str_no;
  74. }
  75.  
  76. string Boolo(int: i)
  77. {
  78.     if (i <> 1)
  79.         return str_yes;
  80.     return str_no;
  81. }
  82.  
  83. string Boolansi(int: i)
  84. {
  85.   if (i = 3)
  86.      return str_no;
  87.   else
  88.    {
  89.      if (i = 1)
  90.        return str_yes;
  91.      if (i = 0)
  92.       return str_no;
  93.    }
  94. }
  95.  
  96. string Boolavatar(int: i)
  97. {
  98.   if (i = 3)
  99.      return str_yes;
  100.   else
  101.      return str_no;
  102. }
  103.  
  104. string HelpLevel(int: help) // Returns a instead of a value
  105. {
  106.   if (help=HELP_NOVICE)
  107.       return str_novic;
  108.   else if (help=HELP_REGULAR)
  109.       return str_regul;
  110.   return str_exper;
  111. }
  112.  
  113. int getdigit(ref string: instr)
  114. {
  115.    int: p, i, l;
  116.    string: temp;
  117.  
  118.    p:=0;
  119.    l:=strlen(instr);
  120.    i:=1;
  121.    while (i <= l)
  122.     {
  123.       if (instr[i] >= '0' AND instr[i] <= '9')
  124.          p:=(p*10)+(instr[i]-'0');
  125.       else l:=i;
  126.         i:=i+1;
  127.     }
  128.    instr:=substr(instr,i,strlen(instr)-i+1);
  129.    return p;
  130. }
  131.  
  132. string UserSex(int: sex)
  133. {
  134.     if (sex=SEX_UNKNOWN)
  135.         return str_sex_unknown;
  136.     else if (sex=SEX_MALE)
  137.         return str_sex_male;
  138.     return str_sex_female;
  139. }
  140.  
  141. string padleft(string: s, int: len, int: ch)
  142. {
  143.   return s + strpad("", len - strlen(s), ch);
  144. }
  145.  
  146. int checkfile(string: filename)
  147. {
  148.  
  149.  if(fileexists(str_st_dir_txt + filename) = FALSE)
  150.  {
  151.    return 1;
  152.  }
  153.  
  154.  return 0;
  155. }
  156.  
  157. void writefile(string: filename)
  158. {
  159.   int:fd;
  160.  
  161.   fd:=open(str_st_dir_txt + filename, IOPEN_CREATE | IOPEN_WRITE);
  162.  
  163.   writeln(fd, "     ");
  164.  
  165.   close(fd);
  166. }
  167.  
  168. string formatdob(string: dob)
  169. {
  170.  
  171.  string: year, month,day;
  172.  
  173.  year := substr(dob, 1, 4);
  174.  
  175.  month := substr(dob, 6, 2);
  176.  
  177.  day:= substr(dob, 9, 2);
  178.  
  179.  #ifdef EUDATE // Use DD-MM-YY
  180.    return (day + "-" + month + "-" + year);
  181.  #endif
  182.  #ifdef USDATE // Use MM-DD-YY
  183.    return (month + "-" + day + "-" + year);
  184.  #endif
  185.  #ifdef JPDATE // Use YY-MM-DD
  186.    return (year + "-" + month + "-" + day);
  187.  #endif
  188. }
  189.  
  190. void pageheader()
  191. {
  192.     print(AVATAR_CLS,"              ", str_st_title, "CoolUser v",  str_st_version, str_st_ver, str_st_title, " Copyright ", str_st_version, "1996-97", str_st_title, " Neil Staib\n", COL_GRAY);
  193.     print(           "              ", str_st_title_line , padleft("", 43, '─'), "\n\n", COL_GRAY);
  194. }
  195.  
  196. void optionbad()  // Display if option is turn off
  197. {
  198.   print(str_st_opt_disable, "\n" , str_st_menu_bad, COL_GRAY);
  199.   sleep(100);
  200. }
  201.  
  202. void editoption(char: h1, char: v1, char:h2, char:v2, string: msg, int: no, char: block, string: cols)
  203. {
  204.   print(AVATAR_GOTO, (char)h1, (char)v1);
  205.   print(cols, padleft(msg, no, block));
  206.   print(AVATAR_GOTO, (char)h2, (char)v2);
  207. }
  208.  
  209. string inputuser(int: no)
  210. {
  211.   string: name;
  212.   int: nameco;
  213.   char: inkey;
  214.  
  215.   name:= "";
  216.   nameco:=1;
  217.  
  218.   inkey:=getch();
  219.  
  220.   while(inkey<>13) // do this until we get <Enter>
  221.   {
  222.     if(inkey=8)             // if we got a <Backspace>
  223.     {
  224.       if(nameco>1)
  225.       {
  226.         print("\bâ–‘\b");
  227.         nameco:=nameco-1;
  228.         name:=substr(name,1,strlen(name)-1);
  229.       }
  230.       else
  231.         name:="";
  232.     }
  233.     else if(nameco>no)     // limit to two digit numbers
  234.     {
  235.       name:="";
  236.     }
  237.     else
  238.     {
  239.       print(inkey);
  240.       name[nameco]:=inkey;
  241.       nameco:=nameco+1;
  242.     }
  243.    inkey:=getch();
  244.   }
  245. return name;
  246. }
  247.  
  248.  
  249.  
  250.